#ifndef _TICKER_H_
#define _TICKER_H_

class Ticker
{
public:
	Ticker();
	virtual ~Ticker();

	virtual void	Init(float Start, float fUpdateSpeed = 1.0f, bool bReset = true);
	virtual bool	Tick(float dt);
	bool			IsComplete() const	{ return m_Display == m_Real; }

	float&			val()	{ return m_Display; }
	float&			real()	{ return m_Real; }

protected:
	float			m_UpdateSpeed;
	float			m_Display;
	float			m_Real;
};

class AccTicker : public Ticker
{
public:
	AccTicker();
	virtual ~AccTicker();

	virtual void	Init(float Start, float fUpdateSpeed = 1.0f, bool bReset = true);
	virtual bool	Tick(float dt);
	void			SetAcceleration(float fAcc) { m_Acceleration = fAcc; }

protected:
	float			m_Acceleration;
	float			m_DesiredUpdate;
};

class AutoTicker : public Ticker
{
public:
	AutoTicker();
	virtual ~AutoTicker();

	virtual bool	Tick(float dt);
	void			SetMaxUpdateTime(float f) { m_MaxUpdateTime = f; }

protected:
	float			m_MaxUpdateTime;
};

#endif // _TICKER_H_
